package cn.le.handler;

import cn.le.bean.enums.EnumMsgCode;
import cn.le.bean.vo.NettyMsg;
import cn.le.netty.inf.NettyHandler;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import org.springframework.stereotype.Component;

@Component
@ChannelHandler.Sharable
public class ReadHandler extends ChannelInboundHandlerAdapter implements NettyHandler {

    @Override
    public void channelRead(ChannelHandlerContext ctx, Object obj) throws Exception {
        NettyMsg msg = (NettyMsg) obj;
        //if (EnumMsgCode.point_send.getCode() == msg.getCode()){
            System.out.println("\n"+msg.getFid()+":"+msg.getContent());
        //}
    }
}
